/*
ID: guoxu1
PROG: subset
LANG: C++
*/
#include <fstream>
#include <vector>
using namespace std;

#define cin fin
#define cout fout

int main()
{
	ifstream fin( "subset.in" );
	ofstream fout( "subset.out" );

	int n = 0;
	cin >> n;
	int sum = (1 + n) * n / 2;
	if( sum % 2 != 0 )
	{
		cout << 0 << endl;
		return 0;
	}

	int half = sum / 2;

	vector<unsigned int> ways(half + 1, 0);
	ways[0] = 1;
	int max = 0;

	for(int i = 1; i <= n; i++)
	{
		for(int j = min( half - i, max ); j >= 0; j--)
		{
			ways[i + j] += ways[j];
		}
		max += i;
	}

	//if( ways[half] % 2 != 0 ) cout << "error!" << endl;
	cout << ways[half] / 2<< endl;

	return 0;
}